<?php
	
	/**
	* @author Robbie Vasquez
 	* @author Matt Kennedy
 	*/
	
class Record extends Controller {

	function Record()
	{
		parent::Controller(); 
	}
	
	function index()
	{
		$this->load->model('Sessions');
		
		$this->Sessions->logged_in();
		
		$this->load->model('Addrun');
		
		$data = array();
		
		$errors = $this->Addrun->record();
	
		$data['errors'] = $errors;
	
		$this->load->view('addrun', $data);
	}
	
	//creating function for user to add runs
	function addrun()
	{
		$this->load->model('Sessions');
		
		$this->Sessions->logged_in();
		
		$this->load->model('Addrun');
		
		$data = array();
		
		$errors = $this->Addrun->record();
	
		$data['errors'] = $errors;
	
		$this->load->view('addrun', $data);
	}
	
	//creating function for user to add routes
	function addroute()
	{
		$this->load->model('Sessions');
		
		$this->Sessions->logged_in();
		
		$this->load->model('Addroute');
		
		$errors = $this->Addroute->record();
		
		$data = array();
		$data['errors'] = $errors;
	
		$this->load->view('addroute', $data);
	}
	
	//creating function for user to delete runs
	function deleterun()
	{
		$this->load->model('Sessions');
		
		$this->Sessions->logged_in();
		
		$this->load->model('Delete');
		
		$this->Delete->run();
	}
	
	//creating function for user to delete routes
	function deleteroute()
	{
		$this->load->model('Sessions');
		
		$this->Sessions->logged_in();
		
		$this->load->model('Delete');
		
		$this->Delete->route();
	}
	
}